import request from '@/config/axios'

export type ProjectTaskVO = {
  productName: string,
  imgUrl: string,
  unit: string,
  remark: string,
  other: string,
}

export const getProjectTaskPage = (params: PageParam): Promise<{
  total: number,
  list: ProjectTaskVO[]
}> => request.get({
  url: '/business/project/task/page',
  params
})
export const getProjectTask = (id: number): Promise<ProjectTaskVO> => request.get({
  url: `/business/project/task/${id}`
})

export const delProjectTaskList = (ids: number[]): Promise<ProjectTaskVO> => request.get({
  url: `/business/project/task/delete`,
  params: {ids: ids.join(',')}
})
export const createProjectTask = (data: ProjectTaskVO) => request.post({
  url: `/business/project/task/create`,
  data
})
export const updateProjectTask = (data: ProjectTaskVO) => request.post({
  url: `/business/project/task/update`,
  data
})

